package com.example.movie.utils;

import com.example.movie.domain.User;

import javax.servlet.http.HttpServletRequest;

public class UserUtil {
    public static User getUserInfo(HttpServletRequest request) {
//        User user = (User) request.getSession().getAttribute("user");

        User user = (User)request.getAttribute("user");
        if (user ==null){
            user=new User();
            user.setUId(1L);
            user.setName("TEST");
            user.setPassword("123456");
        }
        return user;
    }
}
